package com.zmn.plat.common.dictionary;

import java.util.Objects;

/**
 * 合同-公司编码枚举
 *
 * @author linfeng
 * @since 2020/05/14 14:56:30
 */
public enum ContractCompanyEnum {

    /**
     * values
     */
    HZGS(10015, "杭州公司", "HZ"),
    CQGS(10041, "重庆公司", "CQ"),
    ZMNZB(10000, "啄木鸟总部", "ZMN"),
    XAGS(10035, "西安公司", "XA"),
    JNGS(10003, "济南公司", "JN"),
    ZZGS(10007, "郑州公司", "ZZ"),
    KMGS(10011, "昆明公司", "KM"),
    CDGS(10005, "成都公司", "CD"),
    FZGS(10009, "福州公司", "FZ"),
    CSGS(10021, "长沙公司", "CS"),
    SHENZHENGS(10025, "深圳公司", "SZ"),
    HKGS(10001, "海口公司", "HK"),
    SHGS(10027, "上海公司", "SH"),
    NNGS(10019, "南宁公司", "NN"),
    NCGS(10033, "南昌公司", "NC"),
    HFGS(10029, "合肥公司", "HF"),
    GZGS(10043, "广州公司", "GZ"),
    NJGS(10031, "南京公司", "NJ"),
    GYGS(10039, "贵阳公司", "GY"),
    WHGS(10037, "武汉公司", "WH"),
    SHUZHOUGS(10013, "苏州公司", "SZ"),
    TJGS(10023, "天津公司", "TJ"),
    BJGS(10017, "北京公司", "BJ"),
    JXJ(45111, "家修匠", "JXJ"),
    SYGS(44140, "沈阳公司", "SY"),
    XMZGSCN(42521, "厦门子公司-川南", "XM_CN"),
    WHZGSCN(42520, "武汉子公司-川南", "WH_CN"),
    GZZGSCN(42519, "广州子公司-川南", "GZ_CN"),
    NJZGSCN(42258, "南京子公司-川南", "NJ_CN"),
    CSZGSCN(42254, "长沙子公司-川南", "CS_CN"),
    GYZGSCN(42256, "贵阳子公司-川南", "GY_CN"),
    SHZGSCN(41553, "上海子公司-川南", "SH_CN"),
    HZZGSCN(41427, "杭州子公司-川南", "HZ_CN"),
    SZZGSCN(41467, "深圳子公司-川南", "SZ_CN"),
    XAZGSCN(40952, "西安子公司-川南", "XA_CN"),
    HKZGSCN(40951, "海口子公司-川南", "HK_CN"),
    CQZGSCN(40950, "重庆子公司-川南", "CQ_CN"),
    CNHBZB(40000, "川南环保总部", "CNHB"),
    YEYXZB(20000, "言而有信总部", "YEYX"),
    XMGS(17063, "厦门公司", "XM"),
    JHXJ(10100, "家修汇_旧", "JXH"),
    QTGS(0, "其他公司", "QT")
    ;

    private Integer code;
    private String name;
    private String abbreviation;

    ContractCompanyEnum(Integer code, String name, String abbreviation) {
        this.code = code;
        this.name = name;
        this.abbreviation = abbreviation;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getAbbreviation() {
        return abbreviation;
    }

    public static ContractCompanyEnum of(Integer code) {
        if (code == null || code == 0) {
            return QTGS;
        }

        for (ContractCompanyEnum companyEnum: ContractCompanyEnum.values()) {
            if (Objects.equals(companyEnum.getCode(), code)) {
                return companyEnum;
            }
        }

        return QTGS;
    }
}
